

import React, { useEffect, useState } from 'react'
import { Table } from 'antd';
import { ajax } from './../../../api/index';
import { useRootStore } from './../../../index';
import { inject, observer } from 'mobx-react';






const TableS:React.FC = () => {

  const Store = useRootStore()
  useEffect(()=>{

  },[])
  const columns: any = [
    {
      title: "展示图",
      dataIndex: 'img',
      width: 50,
      key:"img",
      render: (record: any) => <img src={record} alt="" width="60px" />
    },
    {
      title: '名称',
      dataIndex: 'name',
      key:"name",
      filters: [],
      onFilter: (name: any, record: any) => record.data.startsWith(name),
      filterSearch: true,
      width: '30%',
    },
    {
      title: '颜色',
      dataIndex: 'color',
      width: 120,
      key:"color",
    },
    {
      title: '尺码',
      dataIndex: 'size',
      width: 120,
      key:"size",
    },
    {
      title: '价格',
      dataIndex: 'discountPrice',
      width: 120,
      key:"discountPrice",
    },
    {
      title: '已售',
      dataIndex: 'sellCount',
      width: 120,
      key:"sellCount",
    },
    
  ];


  function onChange(pagination: any, filters: any, sorter: any, extra: any) {
    console.log('params', pagination, filters, sorter, extra);
  }
  return (
    <div>
      <Table columns={columns} dataSource={Store.data[0]} className="table" /></div>
  )
}

export default TableS